/***************************************************************************
 *   Copyright (C) 2009 by Marian Skvarek   *
 *   skvarek.marian@gmail.com   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef EASYSCORE_CORECPART_H
#define EASYSCORE_CORECPART_H

#include "CGlobals.h"

#include <QString>
#include <QLinkedList>

namespace easyscore
{

	namespace core
	{
		
		class CInstrument;
		class CScore;
                class CTrack;

		class CPartView;

		/**
			Abstract part - series of notes for particular instrument.
			@author Marian Skvarek <skvarek.marian@gmail.com>
		*/
		class CPart
		{	
//Members
			protected:
                                QLinkedList<CTrack *> mTracks;
				CScore *mParentScore;
				
			private:
				bool mInitialized;
//Accessors
			public:
                                QLinkedList<CTrack *> &getTracks() { return mTracks; }
				CScore* getParentScore() const { return mParentScore; }
				void setParentScore ( CScore* value ) { mParentScore = value; }
							
//Constructors, Initialization & Destructors
			public:
				CPart();
				virtual void initialize ();
				
				virtual void clear();
				virtual ~CPart();
				
//Public methods
			public:
				virtual QString getName() = 0;

                                virtual CTrack *getTrackByID(int id) = 0;
				
				virtual CPartView *getPartView() = 0;
				bool hasView() { return getPartView() != 0; }
				virtual void createView() = 0;
				virtual void destroyView() = 0;

                                virtual bool isGuitar() { return false; }

                                virtual bool isPositionOK(NOTE_POSITION pos) { Q_UNUSED(pos); return true; }
                                virtual int maxNoteCount() = 0;

//Protected methods
			protected:
				virtual void updateView() = 0;
				
//Private methods
			private:
				
		}; //class CPart

	}//namespace core
}//namespace easyscore

#endif
